<?php
/**
 * Classe per effettuare il redirect durante la action di un controller, verso un'altra action
 *
 * @author Fabrizio Filieri
 * @category Core
 * @version 1.0
 */
class Redirect
{
    public static function __callStatic($controller_action,  $arguments)
	{
		$ca = explode("_", $controller_action);

		$action = "/" . $ca[0] . "/" . $ca[1];

		if(count($ca) > 2)
		{
			for ($i = 2; $i < count($ca); $i++)
				$action .= "_" . $ca[$i];
		}

		for($i = 0; $i < count($arguments); $i++)
			$action .= "/" . $arguments[$i];

		header('Location: ' . $action. "." . BXD_EXT);

	}
}
?>
